/*
 * Created on 08.11.2006 14:40:29 Author: Josef Schneeberger (josef.schneeberger@fh-deggendorf.de)
 */
package pms.om;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.List;

import java.io.FileInputStream;
import java.sql.Blob;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.sql.Blob;
import com.mysql.jdbc.BlobFromLocator;
import com.sun.swing.internal.plaf.basic.resources.basic;

/**
 * @author josef@dr-schneeberger.de
 */
@Entity
@Table(name="tbl_person")
public class Person {
    @Id
    @GeneratedValue
	@Column(name="pk_person")
    private int id;
    private String vorname;
    private String nachname;
    private String telefon;
    private String abteilung;
    private Date TimeStamp;
    private int present;
    private int hours;
    @Column(length=50000) 
    private byte[] Picture1;
    @Column(length=50000)
    private byte[] Picture2;
    @Column(length=50000)
    private byte[] Picture3;
    @Column(length=50000)
    private byte[] Picture4;
    @Column(length=50000)
    private byte[] Picture5;
    @Column(length=50000)
    private byte[] Picture6;
    @Column(length=50000)
    private byte[] Picture7;
    @Column(length=50000)
    private byte[] Picture8;
    @Column(length=50000)
    private byte[] Picture9;
    @Column(length=50000)
    private byte[] Picture10;
    @Column(length=50000)
    private byte[] Picture11;
    @Column(length=50000)
    private byte[] Picture12;
    @Column(length=50000)
    private byte[] Picture13;
    @Column(length=50000)
    private byte[] Picture14;
    @Column(length=50000)
    private byte[] Picture15;
    @Column(length=50000)
    private byte[] Picture16;
   
   	
    
    //@OneToMany(mappedBy = "image")
    //@ManyToMany(mappedBy = "AnwPerson", fetch = FetchType.LAZY)
    
    @ManyToMany(mappedBy = "AnwPerson", fetch = FetchType.LAZY)
	private Set<BewDat> bewdaten;
   	
   	
//	public Person() {
//    }
//    
    @Override
    public boolean equals(Object o) {
    	return id == ((Person) o).getId();
    }
   	
   	
   	
	public Person() {
    	vorname = "";
    	nachname = "";
    	telefon = "";
    	abteilung = "Eingabe";
    	present = 1;
        hours = 5;
	}
	
	public Person(String vn, String nn, String tel,String dept, Date ts, int pr, int hours, byte[] bFile1, byte[] bFile2 , byte[] bFile3 , byte[] bFile4 , byte[] bFile5 , byte[] bFile6, byte[] bFile7 , byte[] bFile8 , byte[] bFile9 , byte[] bFile10 , byte[] bFile11 , byte[] bFile12 , byte[] bFile13 , byte[] bFile14 , byte[] bFile15 , byte[] bFile16) {
    	vorname = vn;
    	nachname = nn;
    	telefon = tel;
    	abteilung = dept;
    	TimeStamp = new Date();
    	present = pr;
        hours = 5;
        Picture1 = bFile1;
    	Picture2 = bFile2;
    	Picture3 = bFile3;
    	Picture4 = bFile4;
    	Picture5 = bFile5;
    	Picture6 = bFile6;
    	Picture7 = bFile7;
    	Picture8 = bFile8;
    	Picture9 = bFile9;
    	Picture10 = bFile10;
    	Picture11 = bFile11;
    	Picture12 = bFile12;
    	Picture13 = bFile13;
    	Picture14 = bFile14;
    	Picture15 = bFile15;
    	Picture16 = bFile16;

	}

	public Person(String vn, String nn) {
    	vorname = vn;
    	nachname = nn;
    	telefon = "";
    	abteilung = "bla";
    	present = 5;
    	TimeStamp =new Date();
        hours = 5;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getVorname() {
		return vorname;
	}

	public void setVorname(String vorname) {
		this.vorname = vorname;
	}

	public String getNachname() {
		return nachname;
	}

	public void setNachname(String nachname) {
		this.nachname = nachname;
	}

	public String getTelefon() {
		return telefon;
	}

	public void setTelefon(String telefon) {
		this.telefon = telefon;
	}
	
	public String getRaum() {
		return abteilung;
	}

	public void setRaum(String iAbteilung) {
		this.abteilung = iAbteilung ;
	}
	
	public Set<BewDat> getBewdaten() {
		return bewdaten;
	}

	public void setBewdaten(Set<BewDat> bewdaten) {
		this.bewdaten = bewdaten;
	}
	
	public String getAbteilung() {
			return abteilung;
	}

	public void setAbteilung(String iAbteilung) {
		this.abteilung = iAbteilung;
	}

//	ist im Raum?
	public int getPresent() {
		return present;
	}

//	rein gehen oder raus gehen
	public void setPresent(int present) {
		this.present = present;
	}

	public Date getTimeStamp() {
		return TimeStamp;
	}

	public void setTimeStamp(Date TimeStamp) {
		this.TimeStamp = TimeStamp;
	}

	public int getHours() {
		return hours;
	}

	public void setHours(int hours) {
	    this.hours = hours;
	}

	public byte[] getPicture1() {
		return Picture1;
	}

	public void setPicture1(byte[] picture1) {
		Picture1 = picture1 ;
	}

	public byte[] getPicture2() {
		return Picture2;
	}

	public void setPicture2(byte[] picture2) {
		Picture2 = picture2;
	}

	public byte[] getPicture3() {
		return Picture3;
	}

	public void setPicture3(byte[] picture3) {
		Picture3 = picture3;
	}

	public byte[] getPicture4() {
		return Picture4;
	}

	public void setPicture4(byte[] picture4) {
		Picture4 = picture4;
	}

	public byte[] getPicture5() {
		return Picture5;
	}

	public void setPicture5(byte[] picture5) {
		Picture5 = picture5;
	}

	public byte[] getPicture6() {
		return Picture6;
	}

	public void setPicture6(byte[] picture6) {
		Picture6 = picture6;
	}

	public byte[] getPicture7() {
		return Picture7;
	}

	public void setPicture7(byte[] picture7) {
		Picture7 = picture7;
	}

	public byte[] getPicture8() {
		return Picture8;
	}

	public void setPicture8(byte[] picture8) {
		Picture8 = picture8;
	}

	public byte[] getPicture9() {
		return Picture9;
	}

	public void setPicture9(byte[] picture9) {
		Picture9 = picture9;
	}

	public byte[] getPicture10() {
		return Picture10;
	}

	public void setPicture10(byte[] picture10) {
		Picture10 = picture10;
	}

	public byte[] getPicture11() {
		return Picture11;
	}

	public void setPicture11(byte[] picture11) {
		Picture11 = picture11;
	}

	public byte[] getPicture12() {
		return Picture12;
	}

	public void setPicture12(byte[] picture12) {
		Picture12 = picture12;
	}

	public byte[] getPicture13() {
		return Picture13;
	}

	public void setPicture13(byte[] picture13) {
		Picture13 = picture13;
	}

	public byte[] getPicture14() {
		return Picture14;
	}

	public void setPicture14(byte[] picture14) {
		Picture14 = picture14;
	}

	public byte[] getPicture15() {
		return Picture15;
	}

	public void setPicture15(byte[] picture15) {
		Picture15 = picture15;
	}

	public byte[] getPicture16() {
		return Picture16;
	}

	public void setPicture16(byte[] picture16) {
		Picture16 = picture16;
	}
}
